﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Model;
using BLL;

namespace ClassSystem
{
    public partial class ASPAdminteacher : System.Web.UI.Page
    {
        GonggaoBLL bll = new GonggaoBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Label1.Text = DateTime.Now.ToString();


            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text == null && this.TextBox3.Text == null)
            {
                Response.Write("<script>alert('不能为空！')</script>");
            }
            else
            {
                Gonggao DM = new Gonggao();
                DM.StudentNames = this.TextBox1.Text.Trim();
                DM.StudentIDs = Convert.ToInt32(this.TextBox2.Text.Trim());
                DM.StudentSubject = this.TextBox4.Text.Trim();
                DM.StudentAchilve = Convert.ToInt32(this.TextBox3.Text.Trim());


                if (bll.ADD(DM))
                {

                    Response.Write("<script>alert('提交成功')</script>");
                }
                else
                {
                    Response.Write("<script>alert('提交失败')</script>");
                }
            }
        }
    }
}